﻿using PoliAsis.Domain.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace PoliAsis.Domain
{
    public class BaseObject
    {
        public int? id { get; set; }

        public bool IsNew()
        {
            if (id != null && id.Value > 0)
                return true;
            else
                return false;
        }
        public void SetObjectId(int id)
        {
            this.id = id;
        }

        [NonPersistent]
        private bool? _valid = true;

        [NonPersistent]
        public bool? Valid { get { return _valid; } set { _valid = value; } }

        [NonPersistent]
        public string ErrMessage { get; set; }

        public void InValidate() { _valid = false; }



    }
}
